package com.yunwaikeji.gy_tool_library.utils.http;

import com.yunwaikeji.gy_tool_library.utils.http.download.GYDownloadModel;
import com.yunwaikeji.gy_tool_library.utils.http.download.GYDownloadTask;
import com.yunwaikeji.gy_tool_library.utils.http.upload.GYUploadModel;
import com.yunwaikeji.gy_tool_library.utils.http.upload.GYUploadTask;

public class GYHttpUtils {
    public static GYHttpTask newHttpTask() {
        return new GYHttpTask();
    }

    public static GYUploadTask newUploadTask() {
        return new GYUploadTask();
    }

    public static GYDownloadTask newDownloadTask() {
        return new GYDownloadTask();
    }

    public static GYHttpModel<?> newHttpModel() {
        return new GYHttpModel<>();
    }

    public static GYUploadModel<?> newUploadModel() {
        return new GYUploadModel<>();
    }

    public static GYDownloadModel<?> newDownloadModel() {
        return new GYDownloadModel<>();
    }

    private static GYHttpUtils loadUtils;

    public static GYHttpUtils getInstance() {
        if (loadUtils == null) {
            synchronized (GYHttpUtils.class) {
                if (loadUtils == null) {
                    loadUtils = new GYHttpUtils();
                }
            }
        }
        return loadUtils;
    }
}
